-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTERNAL PR js-iden3-auth: VidosResolver #1
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of suggests to duplicate in both methods
src/state/vidosResolver.ts
Outdated
import { Id } from '@iden3/js-iden3-core'; | ||
import { type IStateResolver, type ResolvedState, isGenesisStateId } from './resolver'; | ||
|
||
type DidResolutionResult = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you import import type { DIDResolutionResult } from 'did-resolver';
instead of defining it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done fa1ed4c, needed to extend the type for it to facilitate the Polygon ID state fields.
src/state/vidosResolver.ts
Outdated
const stateHex = state.toString(16); | ||
|
||
const zeroAddress = '11111111111111111111'; // 1 is 0 in base58 | ||
const did = `did:polygonid:polygon:amoy:${zeroAddress}?gist=${stateHex}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about how to make this work on different networks other than Amoy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done cc4047c, added a network
param to the VidosResolver
constructor.
}); | ||
const result = (await response.json()) as DidResolutionResult; | ||
|
||
const globalInfo = result.didDocument.verificationMethod[0].global; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest checking for an error in result.didResolutionMetadata.error
before going too far as otherwise likely will give an incorrect result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 7165914, error is thrown on such resolution error
This PR is implementing
VidosResolver
to be used as state resolver for the js-iden3.Example PR: mailchain/polygonid-tutorial-examples#1